package com.uottawa.clickerapp.domain;

import javax.xml.bind.annotation.XmlRootElement;

import com.uottawa.clickerapp.dao.impl.*;

@XmlRootElement
public class Answer extends DataStoreEntity {
	
	private String answerText;
	private long questionID;
	
	long polls;
	
	public long getPolls() {
		SQLDBHelper.getPolls(this.ID);
		return polls;
	}

	public void setPolls(long polls) {
		this.polls = polls;
	}

	public String getAnswerText() {
		return answerText;
	}
	
	public void setAnswerText(String answerText) {
		this.answerText = answerText;
	}
	
	public long getQuestionID() {
		return questionID;
	}

	public void setQuestionID(long questionID) {
		this.questionID = questionID;
	}
	
	public void save(){
		SQLDBHelper.store(this);
	}
	
	public void fetch(){
		if (this.ID != 0){ 
			SQLDBHelper.fetch(this);
		}
	}
	
	public void delete(){
		SQLDBHelper.delete(this);
	}

}
